<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>日期、时间和计时器</title>
</head>
<body>
<script>
    var milliseceondsDelay = 300;
    var timeId = setTimeout(yourFunction, milliseceondsDelay);
    document.write(timeId.toString());
    function yourFunction() {

    }

    var myTimerId=setInterval(myFunction,5000);
    document.write(myTimerId.toString());
    function myFunction() {

    }
    clearInterval(myTimerId);
</script>
</body>
</html>